/**
 * file
 */
package com.tdkj.action.front.member.risevalue;

import java.util.List;

import javax.annotation.Resource;

import com.opensymphony.xwork2.ActionContext;
import com.tdkj.action.BaseAction;
import com.tdkj.model.information.BeanBaseInfo;
import com.tdkj.model.risevalue.BeanFloatColorCustom;
import com.tdkj.model.user.BeanUser;
import com.tdkj.service.risevalue.IBeanFloatColorCustomService;
import com.tdkj.service.risevalue.IBeanFloatColorService;
import com.tdkj.util.PublicConfing;

public class InfoFloatColorAction extends BaseAction {
	
	private Integer color ;
	
	private Long customId ;

	private IBeanFloatColorCustomService floatColorCustomService;
	
	private IBeanFloatColorService floatColorService;
	
	private List<BeanFloatColorCustom> customs;
	
	private List<BeanBaseInfo> floatedInfos;
	
	private List<BeanBaseInfo> notFloatedInfos;
	
	public String execute(){
		BeanUser user  = (BeanUser)ActionContext.getContext().getSession().get(PublicConfing.MEMBER_MEMBWE_OBJ_STRING_CONFIG);
		Long userId = user.getId();
		
		customs = floatColorCustomService.getAll();
		
		floatedInfos = floatColorService.getInfos(userId, true);
		
		notFloatedInfos = floatColorService.getInfos(userId, false);
		
		return "success";
	}
	
	public String createBuy(){
		BeanUser user  = (BeanUser)ActionContext.getContext().getSession().get(PublicConfing.MEMBER_MEMBWE_OBJ_STRING_CONFIG);
		Long userId = user.getId();
		
		//floatColorService.createBuy(userId, customId, color);
		
		return execute();
	}

	/**
	 * @return the color
	 */
	public Integer getColor() {
		return color;
	}

	/**
	 * @param color the color to set
	 */
	public void setColor(Integer color) {
		this.color = color;
	}

	/**
	 * @return the customId
	 */
	public Long getCustomId() {
		return customId;
	}

	/**
	 * @param customId the customId to set
	 */
	public void setCustomId(Long customId) {
		this.customId = customId;
	}

	/**
	 * @return the customs
	 */
	public List<BeanFloatColorCustom> getCustoms() {
		return customs;
	}

	/**
	 * @param customs the customs to set
	 */
	public void setCustoms(List<BeanFloatColorCustom> customs) {
		this.customs = customs;
	}

	/**
	 * @return the floatedInfos
	 */
	public List<BeanBaseInfo> getFloatedInfos() {
		return floatedInfos;
	}

	/**
	 * @param floatedInfos the floatedInfos to set
	 */
	public void setFloatedInfos(List<BeanBaseInfo> floatedInfos) {
		this.floatedInfos = floatedInfos;
	}

	/**
	 * @return the notFloatedInfos
	 */
	public List<BeanBaseInfo> getNotFloatedInfos() {
		return notFloatedInfos;
	}

	/**
	 * @param notFloatedInfos the notFloatedInfos to set
	 */
	public void setNotFloatedInfos(List<BeanBaseInfo> notFloatedInfos) {
		this.notFloatedInfos = notFloatedInfos;
	}

	/**
	 * @param floatColorCustomService the floatColorCustomService to set
	 */
	@Resource
	public void setFloatColorCustomService(
			IBeanFloatColorCustomService floatColorCustomService) {
		this.floatColorCustomService = floatColorCustomService;
	}

	/**
	 * @param floatColorService the floatColorService to set
	 */
	@Resource
	public void setFloatColorService(IBeanFloatColorService floatColorService) {
		this.floatColorService = floatColorService;
	}
	
	
}
